<script setup>
import { useI18n } from 'vue-i18n';
import { triggerAction } from '../assets/hotkeys';

const { t } = useI18n();
const openFile = () => { try { triggerAction('file:openFile'); } catch {} };
const openFolder = () => { try { triggerAction('file:openFolder'); } catch {} };
</script>

<template>
  <div class="h-full w-full flex items-center justify-center">
    <div class="text-center max-w-xl px-6">
      <h1 class="text-2xl font-semibold mb-2">{{ t ? (t('app.settings_title') || 'Welcome') : 'Welcome' }}</h1>
      <p class="text-sm text-muted-fg mb-6">开始之前，先打开一个文件或文件夹</p>
      <div class="flex gap-3 justify-center">
        <button class="px-4 py-2 rounded bg-primary text-white hover:opacity-90" @click="openFile">{{ t ? (t('menu.open_file') || 'Open File...') : 'Open File...' }}</button>
        <button class="px-4 py-2 rounded border border-panel-border hover:bg-panel-bg" @click="openFolder">{{ t ? (t('menu.open_folder') || 'Open Folder...') : 'Open Folder...' }}</button>
      </div>
    </div>
  </div>
</template>


